package com.travel.service.impl;

import java.util.List;

import com.travel.dao.ScenicOrderDao;
import com.travel.dao.impl.ScenicOrderDaoImpl;
import com.travel.entity.ScenicOrder;
import com.travel.service.ScenicOrderService;
import com.travel.util.PageInfo;

public class ScenicOrderServiceImpl implements ScenicOrderService {

	private ScenicOrderDao scenicOrderDao = new ScenicOrderDaoImpl();

	@Override
	public PageInfo<ScenicOrder> findByPage(int pageNum, int pageSize,String userName) {
		if (pageNum <= 0) {
			pageNum = 1;
		}
		if (pageSize <= 0) {
			pageSize = 10;
		}
		return scenicOrderDao.findByPage(pageNum, pageSize, userName);
	}

	@Override
	public boolean delete(int scenicOrderId) {
		int scenicOrderId2 = scenicOrderDao.scenicOrderId(scenicOrderId);
		return scenicOrderId2 > 0 ? true : false;
	}

	@Override
	public boolean insert(ScenicOrder scenicOrder) {
		return scenicOrderDao.insert(scenicOrder) > 0 ? true : false;
	}

	@Override
	public List<ScenicOrder> find() {
		return scenicOrderDao.find();
	}

}
